import socket,sys,time
from server_json import  Json_encoder
from  server_json import  Json_decoder
host =  sys.argv[1]
port = sys.argv[2]
port = int(port)
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
#s.setsockopt(socket.SOL_SOCKET.socket.SO_BROADCAST,1)

#buf = {"name":"qingluan","state":"on"}
#js = Json_encoder().encode(buf)
while True:
	time.sleep(1)
	js = "check ,from qingluan   : %s "% time.ctime()
	length = len(js)
	print js 
	s.sendto(js,(host,port))


